package com.ruoyi.js.service.impl;

import java.util.List;
import com.ruoyi.framework.util.ShiroUtils;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.framework.util.ShiroUtils;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.js.mapper.JsJudgeMapper;
import com.ruoyi.js.domain.JsJudge;
import com.ruoyi.js.service.IJsJudgeService;
import com.ruoyi.common.core.text.Convert;

/**
 * 裁判 Service业务层处理
 * 
 * @author greejoy
 * @date 2024-10-16
 */
@Service
public class JsJudgeServiceImpl implements IJsJudgeService 
{
    @Autowired
    private JsJudgeMapper jsJudgeMapper;

    /**
     * 查询裁判 
     * 
     * @param id 裁判 ID
     * @return 裁判 
     */
    @Override
    public JsJudge selectJsJudgeById(Long id)
    {
        return jsJudgeMapper.selectJsJudgeById(id);
    }

    /**
     * 查询裁判 列表
     * 
     * @param jsJudge 裁判 
     * @return 裁判 
     */
    @Override
    public List<JsJudge> selectJsJudgeList(JsJudge jsJudge)
    {
        return jsJudgeMapper.selectJsJudgeList(jsJudge);
    }

    /**
     * 新增裁判 
     * 
     * @param jsJudge 裁判 
     * @return 结果
     */
    @Override
    public int insertJsJudge(JsJudge jsJudge)
    {
        jsJudge.setCreateBy(ShiroUtils.getLoginName());
        jsJudge.setCreateTime(DateUtils.getNowDate());
        return jsJudgeMapper.insertJsJudge(jsJudge);
    }

    /**
     * 修改裁判 
     * 
     * @param jsJudge 裁判 
     * @return 结果
     */
    @Override
    public int updateJsJudge(JsJudge jsJudge)
    {
        jsJudge.setUpdateBy(ShiroUtils.getLoginName());
        jsJudge.setUpdateTime(DateUtils.getNowDate());
        return jsJudgeMapper.updateJsJudge(jsJudge);
    }

    /**
     * 删除裁判 对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteJsJudgeByIds(String ids)
    {
        return jsJudgeMapper.deleteJsJudgeByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除裁判 信息
     * 
     * @param id 裁判 ID
     * @return 结果
     */
    @Override
    public int deleteJsJudgeById(Long id)
    {
        return jsJudgeMapper.deleteJsJudgeById(id);
    }

    @Override
    public List<JsJudge> selectJsJudgeListByIds(String ids)
    {
        return jsJudgeMapper.selectJsJudgeListByIds(Convert.toStrArray(ids));
    }
}
